//
//  NSMutableAttributedString+ZHExtension.m
//  ZHCategory
//
//  Created by zhusanbao on 2021/1/11.
//

#import "NSMutableAttributedString+ZHExtension.h"

@implementation NSMutableAttributedString (ZHExtension)

- (NSMutableAttributedString *)zh_AddFont:(UIFont *)font color:(UIColor *)color range:(NSRange)range{
    NSMutableDictionary *dic = NSMutableDictionary.dictionary;
    dic[NSFontAttributeName]             = font;
    dic[NSForegroundColorAttributeName]  = color;
    [self addAttributes:dic range:range];
    return self;
}

- (NSMutableAttributedString *)zh_AddFont:(UIFont *)font range:(NSRange)range{
    [self addAttribute:NSFontAttributeName value:font range:range];
    return self;
}

- (NSMutableAttributedString *)zh_AddColor:(UIColor *)color range:(NSRange)range{
    [self addAttribute:NSForegroundColorAttributeName value:color range:range];
    return self;
}

@end
